package com.gjm.demo.service;

import com.gjm.demo.model.Student;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

@Service
public class StuService {

    @Bean
    public String name1() {
        return "zhangsan111";
    }

    @Bean
    public String name2() {
        return "zhangsan222";
    }


    @Bean
    public Student s1(@Qualifier("name1") String name) {
        return new Student(name, 12);
    }

    @Bean
    public Student s2() {
        return new Student("lisi", 14);
    }
}
